#include <stdio.h>

int main(int argc, char *argv[])
{
    int n;
    while (scanf("%d", &n) != EOF)
    {
        if (n == 0)
            break;
        if (n == 1)
        {
            printf("0\n");
            continue;
        }

        int count = 0;
        while (n!=1)    
        {
            //每三个分在一起,即可一次就判断处假币,这时候是看能把币分为几堆
            if(n % 3==0){
                n /= 3;
                count++;
            }else{
                n = n / 3 + 1;
                count++;
            }
        }

        printf("%d\n", count);
    }

    return 0;
}